#define _CRT_SECURE_NO_WARNINGS 1

#include "SList.h"


void test1()
{
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 5);
	SListPrint(plist);
}

void test2()
{
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 5);
	SListPushBack(&plist, 6);
	SListPrint(plist);
	SListInsertAfter(SListFind(plist, 2), 3);
	SListPrint(plist);
	SListEraseAfter(SListFind(plist, 2));
	SListPrint(plist);
}

void test3()
{
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 5);
	SListPrint(plist);

	int x;
	scanf("%d", &x);
	SListNode* pos = SListFind(plist, x);
	if (pos)
	{
		//SListErase(&plist, pos);
		SListEraseAfter(pos);
		pos = NULL;
	}
	SLTPrint(plist);
}

int main()
{
	//test1();
	//test2();
	test3();
	return 0;
}